package com.service;

import com.pojo.Department;
import com.pojo.SysUser;
import com.vo.UserVo;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.security.Principal;
import java.util.List;
import java.util.Map;

/**
 * @author mornd
 * @date 2020/11/12 - 14:04
 */
public interface UserService extends UserDetailsService {
    //查询所有用户
    List<SysUser> findUserList(UserVo userVo);

    //根据deptId查询员工数量 判断该部门是否可以删除
    int checkDeptByUser(Integer deptId);

    //添加用户
    Map<String,Object> addUser(SysUser sysUser, Principal principal);
    //修改用户
    Map<String,Object> updateUser(SysUser sysUser,Principal principal);
    //删除用户信息
    boolean deleteUser(Integer userId);

    //用户添加权限
    boolean addRoleByuserId(List<Integer> ids,Integer userId,Principal principal);
    //根据用户名称查询用户信息
    SysUser findUserInfoByUserName(String userName);
    //根据用户id查询用户信息
    SysUser findUserById(Integer id);
}
